/*
    Project Milestone 3
    by Lorenzo Miori [Lorenzo.Miori@stud-inf.unibz.it,
    Matteo Angriman [Matteo.Angriman@stud-inf.unibz.it],
    Nick Preda [Nicolae.Preda@stud-inf.unibz.it]
*/

package DB;

import java.util.*;
/**
 * This is the generic interface to a database connector
 * It allows getting a new unique ID out, get tuples from a table and set or
 * update data in a table
 * @author Lorenzo
 */
public interface GenericDBInterface {
    /* Enumerate valid data types */
    public int INT = 0;
    public int STRING = 1;
    public int BOOLEAN = 2;
    public int DATE = 3;
    public int REAL = 4;

    /**
     * Get a new unique ID to be used e.g when adding new entries to a table
     */
    public int getUniqueID();
    
    /**
     * Get table contents
     */
    public ArrayList<HashMap<String, String>> getTableData();
    
    /**
     * 
     */
    public HashMap<String, String> getRowByID(int ID);
    
    /**
     * Set/Update table contents
     */
    public boolean setTableData(HashMap<String, String> data);
    
    /**
     * Remove data from a table
     * It is sufficient its unique ID
     */
    public boolean removeTupleFromTable(int uniqueID);
}